package panda.query.condition;

import panda.query.scan.Scanner;
import panda.query.struct.Attribute;
import panda.query.tree.QueryTreeNode;
import panda.transaction.Transaction;

/**
 * The expression that corresponds to a boolean expression
 * @author Tian Yuan
 *
 */
public interface BooleanExpression {
	
	/**
	 * 
	 * @param s
	 * @return
	 */
	public int isSatisfied(Scanner s, Transaction tx); 
	
	/**
	 * Judge an attribute equates with how many constants
	 * @param attr 
	 * @return
	 */
	public int equateWithConstant(Attribute attr);
	
	/**
	 * 
	 * @param n
	 * @return
	 */
	public double reductionFactor(QueryTreeNode n);
}
